#ifndef __HTTP_MY_H__
#define __HTTP_MY_H__

#include "esp_http_server.h"
#include "esp_timer.h"
#include "wifi_my.h"
#include "esp_log.h"
#include "sys/param.h"
#include "cJSON.h"
#include "esp_err.h"
#include "esp_system.h"
#include "stdio.h"
#include "uart_my.h"
#include "user_my.h"
#include "oled_my.h"

#define REQUEST_DATA_SIZE 512
#define RESPONSE_DATA_SIZE 256

#define DELAY_HANDLE_PERIOD 1000 * 1000 // 1s

httpd_handle_t HttpServerInit(void);

void sendGetResponse(bool responseOk, char *pResponseData, cJSON *pResult);
void sendPostResponse(bool responseOk, char *pResponseData, cJSON *pResult);
void jsonPackageResponseData(bool responseOk, char *pSendData, cJSON *pResult);

/* 路由接口函数 */
void queryClientInfo(cJSON *pResult);
void configWifi(char *pRequestData, cJSON *pResult);
void configUserInfo(char *pRequestData, cJSON *pResult);
void configDeviceInfo(char *pRequestData, cJSON *pResult);
void configDHTInfo(char *pRequestData, cJSON *pResult);

#endif